package com.storyroad.responseClasses;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;

/**
 * Fields of this class are used to store information about a comment. Instances of this class are sent to the
 * front-end to be used when listing the comments of a story. Accumulating all the data in an object facilitates
 * transfer of data as well as receiving and processing it.
 */
public class Comment {
	private String username;
	private String body;
	private String date;

	public Comment(String username, String body, Timestamp date) {
		this.username = username;
		this.body = body;
		this.date = new SimpleDateFormat("YYYY.MM.dd HH:mm.ss").format(date);
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

}
